package com.dmp.onlinestore.view.base;
import com.dmp.onlinestore.view.base.ViewDefs;

public class ViewAddressFactory {
	
	private static int VIEW_MODE_NO_FRILLS   = 0;
	private static int VIEW_MODE_SPIFFY      = 1;

	// Currently active view mode.
	private static int VIEW_MODE = VIEW_MODE_NO_FRILLS;
	//private static int VIEW_MODE = VIEW_MODE_SPIFFY;
	
	private static ViewAddressFactory instance = null;
	
	// Hide the constructor.
	private ViewAddressFactory () {
	}
	
	public static ViewAddressFactory instance() {
		if (instance == null) {
			instance = new ViewAddressFactory();
		}
		return instance;
	}

	public String getWelcome () {
		// Only have a no-frills version right now.
		return ViewDefs.VIEW_ROOT_DIR + ViewDefs.VIEW_SUBDIR_NO_FRILLS + ViewDefs.VIEW_WELCOME;
	}
	public String getCatalog () {
	    if (VIEW_MODE == VIEW_MODE_NO_FRILLS) {
	    	return ViewDefs.VIEW_ROOT_DIR + ViewDefs.VIEW_SUBDIR_NO_FRILLS + ViewDefs.VIEW_CATALOG;
	    }
	    else if (VIEW_MODE == VIEW_MODE_SPIFFY){
	    	return ViewDefs.VIEW_ROOT_DIR + ViewDefs.VIEW_SUBDIR_SPIFFY + ViewDefs.VIEW_CATALOG;
	    }
	    else {
	    	// Default is no frills.
	    	return ViewDefs.VIEW_ROOT_DIR + ViewDefs.VIEW_SUBDIR_NO_FRILLS + ViewDefs.VIEW_CATALOG;
	    }
	}
	public String getGeneralError () {
		// Only have a no-frills version right now.
		return ViewDefs.VIEW_ROOT_DIR + ViewDefs.VIEW_SUBDIR_NO_FRILLS + ViewDefs.VIEW_GENERAL_ERROR;
	}
	public String getPageNotFound () {
		// Only have a no-frills version right now.
		return ViewDefs.VIEW_ROOT_DIR + ViewDefs.VIEW_SUBDIR_NO_FRILLS + ViewDefs.VIEW_PAGE_NOT_FOUND;
	}
	

//	public String getHeader () {
//		// Only have a no-frills version right now.
//		return ViewDefs.VIEW_ROOT_DIR + ViewDefs.VIEW_SUBDIR_NO_FRILLS + ViewDefs.VIEW_HEADER;
//	}
}
